<#escape x as (x)!"">
<!DOCTYPE html>
<html>
<head>
<title>${comments}</title>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <!-- 全局css -->
    <link href="../css/bootstrap.min.css?v=3.3.7" rel="stylesheet">
    <link rel="stylesheet" href="../fonts/font-awesome/font-awesome.css">
    <link rel="stylesheet" href="../fonts/web-icons/web-icons.css">
    <link rel="stylesheet" href="../js/plugins/elementui/index.css">
    <link rel="stylesheet" href="../js/plugins/toastr/toastr.css">
	  <link rel="stylesheet" href="../css/skins/style.css" >
    <link rel="stylesheet" href="../css/common.css" >
    <link rel="stylesheet" href="../css/sys.css" >

    <!-- 全局js -->
    <script src="../js/plugins/jquery/jquery.min.js?v=2.1.4"></script>
    <script src="../js/plugins/layer/layer.min.js"></script>
    <script src="../js/plugins/bootstrap/bootstrap.min.js?v=3.3.6"></script>
    <script src="../js/plugins/vue/vue.min.js"></script>
    <script src="../js/plugins/elementui/index.js"></script>
    <script src="../js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
    <script src="../js/plugins/toastr/toastr.min.js"></script>
    <script src="../js/plugins/tableExport/libs/FileSaver/FileSaver.min.js"></script>
    <script src="../js/plugins/tableExport/libs/js-xlsx/xlsx.core.min.js"></script>
    <script src="../js/plugins/tableExport/tableExport.min.js"></script>
    <script src="../js/common.js"></script>
</head>
<body class="gray-bg">
<div class="wrapper-content" id="rrapp" v-cloak>
    <div class="row cmm">
        <div class="col-sm-12">
            <!--列表 begin-->
            <div class="ibox " v-show="showList">
                <div class="ibox-title">
                    <h5>SP峰值按天</h5>
                </div>
                <div class="ibox-content">
                  <div v-show="showList">
                        <div class="grid-btn box search-panel">
                          <table class="table table-bordered search">
                            <tbody>
                            <tr>
                              <td class="search-label">
                                时间
                              </td>
                              <td class="search-content">
                                <el-checkbox label="启用" name="type" v-model="q.timeChecked"></el-checkbox>
                                <el-date-picker
                                        v-model="q.startTime" type="datetime" :picker-options="pickerOptions1"
                                        value-format="yyyy-MM-dd HH:mm:ss" placeholder="开始时间">
                                </el-date-picker>
                                至
                                <el-date-picker
                                        v-model="q.endTime" type="datetime" :picker-options="pickerOptions1"
                                        value-format="yyyy-MM-dd HH:mm:ss" placeholder="结束时间">
                                </el-date-picker>
                              </td>
                              <td class="search-operater">
                                <a class="btn btn-info btn-sm" @click="addAnd"><i
                                        class="fa fa-plus"></i>&nbsp;AND条件</a>
                                <a class="btn btn-info btn-sm" @click="addOr"><i
                                        class="fa fa-plus"></i>&nbsp;OR条件</a>
                              </td>
                            </tr>
                            <tr v-for="item in q.criterias" v-if="item.del==false">
                              <td class="search-label">
                                ({{item.opt}})条件
                              </td>
                              <td class="search-content">
                                <table class="table table-bordered operater">
                                  <tr v-for="opt in item.optList" v-if="opt.del==false">
                                    <td style="width: 100px">
                                      <el-select v-model="opt.opt" style="width: 100px"
                                                placeholder="请选择">
                                        <el-option
                                                v-for="item in optList" :key="item.value" :label="item.text"
                                                :value="item.value"></el-option>
                                      </el-select>
                                    </td>
                                    <td style="width: 130px">
                                      <el-select v-model="opt.column" style="width: 150px"
                                                placeholder="请选择">
                                        <el-option
                                                v-for="item in selectList" :key="item.value" :label="item.text"
                                                :value="item.value"></el-option>
                                      </el-select>
                                    </td>
                                    <td style="width: 150px">

                                      <el-select v-model="opt.operator"
                                                placeholder="请选择">
                                        <el-option
                                                v-for="item in operatorList" :key="item.value" :label="item.text"
                                                :value="item.value"></el-option>
                                      </el-select>
                                    </td>
                                    <td class="text-center">

                                      <el-input v-model="opt.value" v-if="opt.column != 'a.AREACODE'"
                                                auto-complete="off"></el-input>

                                      <el-select v-model="opt.value"  v-if="opt.column == 'a.AREACODE'"
                                                placeholder="请选择">
                                        <el-option
                                                v-for="item in provinceList" :key="item.code" :label="item.name"
                                                :value="item.code"></el-option>
                                      </el-select>
                                    </td>
                                    <td>
                                      <a class="btn btn-danger btn-xs" @click="opt.del=true"><i
                                              class="fa fa-trash-o"></i>&nbsp;删除</a>
                                    </td>
                                  </tr>
                                </table>
                              </td>
                              <td class="search-operater">
                                <a class="btn btn-info btn-sm" @click="addItem(item)"><i
                                        class="fa fa-plus " ></i>&nbsp;添加</a>
                                <a class="btn btn-danger btn-sm" @click="item.del=true"><i
                                        class="fa fa-trash-o"></i>&nbsp;删除</a>
                              </td>
                            </tr>
                            <tr v-show="showSql">
                              <td class="search-label">
                                SQL
                              </td>
                              <td class="search-content" colspan="2">
                                        <pre>{{sql}}
                                        </pre>
                                <a class="btn btn-info btn-sm" @click="sqlHide()">隐藏SQL</a>
                              </td>
                            </tr>
                            <tr>

                              <td class="search-operater" colspan="3">
                                <a class="btn btn-success" @click="query"><i
                                        class="fa fa-search"></i>&nbsp;查询</a>
                                &nbsp; &nbsp;

                                <a class="btn btn-info" @click="getSql"><i
                                        class="fa  fa-database"></i>&nbsp;生成SQL</a>
                              </td>

                            </tr>
                            </tbody>
                          </table>
                        </div>

                      <div class="text-left" style="padding: 5px">
                            <div style="vertical-align: baseline">
                                <div class="col-lg-6  col-md-6 text-left" style="height: 41px;padding-left: 5px;padding-top: 15px;">
                                共 <strong>{{total}}</strong> 条数据</div>
                                <div class="col-lg-6 col-md-6 text-right" style="padding-bottom: 5px;padding-right: 0px">
                                    <el-dropdown size="medium" split-button type="default" @click="exportExl" @command="handleCommand">
                                        <i class="fa fa-download"></i> 导出数据
                                        <el-dropdown-menu slot="dropdown">
                                            <el-dropdown-item command="a">csv</el-dropdown-item>
                                            <el-dropdown-item command="b">txt</el-dropdown-item>
                                            <el-dropdown-item command="c">Excel</el-dropdown-item>
                                            <el-dropdown-item command="d">服务器下载</el-dropdown-item>
                                        </el-dropdown-menu>
                                    </el-dropdown>
                                </div>
                            </div>
                            <div style="width: 100%">
                                <table id="data" class="table table-bordered table-hover">
                                    <thead class="thead-default">
                                      <tr>
                                        <th class="text-center" style="width: 50px">#</th>
                                        <th class="text-center" v-for="ols in columnsList">{{ols.name}}</th>
                                      </tr>
                                    </thead>
                                    <tbody>
                                      <tr v-for="(item,index) in dataList">
                                        <td class="text-center">{{index+1}}</td>
                                        <#if columns??>
                                            <#list columns as column>
                                                <#if !column.nolist>
                                                  <#if column.map??>
                                        <td class="text-center" v-if="columnsList[${column_index}].isShow">{{${column.attrname}Map[item
                                        .${column.attrname}]}}</td>
                                                  <#else>
                                        <td class="text-center" v-if="columnsList[${column_index}].isShow">{{item.${column.attrname}}}</td>
                                                  </#if>
                                                </#if>
                                              </#list>
                                        </#if>
                                      </tr>
                                    </tbody>
                                </table>
                                <div class="text-center" v-show="dataList.length == 0">没有数据</div>
                            </div>
                      </div>
                  </div>
                </div>
            </div>
        </div>
    </div>
</div>


<script src="../${modulePackage}/js/${functionName}.js"></script>
</body>
</html>
</#escape>